import request from '@/utils/request'
/**
 *  查询企业的部门列表
 * @returns
 */
export function getDeptList() {
  return request({
    method: 'GET',
    url: '/company/department'
  })
}
/**
 * 根据ID删除部门
 * @param {*} id 部门id
 * @returns
 */
export function delDepart(id) {
  return request({
    method: 'DELETE',
    url: `/company/department/${id}`
  })
}
/**
 * 新增部门
 * @returns
 */
export function addDepart(data) {
  return request({
    method: 'post',
    url: '/company/department',
    data
  })
}
// 根据ID查询部门详情
/**
 * 根据ID查询部门详情
 * @param {*} id
 * @returns
 */
export function getDeptDetail(id) {
  return request({
    url: `/company/department/${id}`
  })
}

export function editDept(data) {
  return request({
    method: 'PUT',
    url: `/company/department/${data.id}`,
    data
  })
}
